package com.siki.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.siki.pojo.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author Siki
 * @Date 2020/3/19
 */
@Mapper
@Repository
public interface UserMapper extends BaseMapper<User> {

   @Select("select gu.*, gd.* from gq_user gu, gq_department gd where gu.id=#{id}")
   User queryOneUser(@Param("id") String id);


   Page<User> findByPage();

   User selectUserByNumber(String number);

   int insertUser(User user);

   List<User> queryUserByEq(Page page, @Param(Constants.WRAPPER) QueryWrapper<User> wrapper);
}
